home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / systems / atari / birkhahn-metafont-packed-disks / mf27-2_2e-disk2.zoo / inputs / pandora.lzs / PUNCTT.MF < prev    next >
Text File  |  1991-08-15  |  7KB  |  184 lines

  1. %*****************************************************************************
  2. %        Copyright (c) 1989 by N. N. Billawala
  3. %*****************************************************************************
  4.  
  5.  
  6. % punctt.mf  punctuation: for typewriter text set
  7.  
  8. % 8 characters
  9.  
  10.  
  11. iff OK "-":  "Minus sign";
  12.   beginchar(oct"055",.5width#+b_mono#,cap#,0); 
  13.   pickup mathpen;
  14.   lft z1=(0,math_axis)//;
  15.   rt z2=lft z1+(w,0);
  16.   draw z1--z2;
  17. adjust(v_a*fitbasis.uc#+m_a*b_mfit#,v_a*fitbasis.uc#+m_a*b_mfit#); 
  18. show_character; endchar;
  19.  
  20. % use different mathpen for softness
  21. % character position, but not shape slants with obliqueness
  22. % must make sure that the plus/minus have the same widths
  23.  
  24.  
  25. iff OK "<":  "Less than"; 
  26.   beginchar(oct"074",.4width#+b_mono#,cap#,0); 
  27.   min_limit(join_radius)(.5mathlines);
  28.   lft z2r=lft z4r=(0,math_axis)//;     
  29.   top z1r=(lft x2r+min(w,math_axis+.5h),math_axis+.4h);   
  30.   bot z3r=(lft x2r+min(w,math_axis+.5h),math_axis-.4h);    
  31.   multpos(1,2)(mathlines,angle(z1r-z2r)+90);
  32.   multpos(3,4)(mathlines,angle(z4r-z3r)+90);
  33.   z40=(z1l--z2l)intersectionpoint(z3l--z4l);
  34.  
  35.   p1=(z40 soften(z3l,z3r,z2r,z1r,z1l) z40)--cycle;
  36.  
  37.   showpoints(1,2,3,4,40);
  38. adjust(v_F*fitbasis.uc#+m_a*b_mfit#,v_H*fitbasis.uc#+m_a*b_mfit#); 
  39. show_character; endchar;
  40.  
  41.  
  42. iff OK ">":  "Greater than"; 
  43.   beginchar(oct"076",.4width#+b_mono#,cap#,0); 
  44.   min_limit(join_radius)(.5mathlines);
  45.   rt z2r=rt z4r=(min(w,math_axis+.5h),math_axis)//;  
  46.   top z1r=(0,math_axis+.4h);   
  47.   bot z3r=(0,math_axis-.4h);    
  48.   multpos(1,2)(mathlines,angle(z1r-z2r)-90);
  49.   multpos(3,4)(mathlines,angle(z4r-z3r)-90);
  50.   z40=(z1l--z2l)intersectionpoint(z3l--z4l);
  51.  
  52.   p1=(z40 soften(z3l,z3r,z2r,z1r,z1l) z40)--cycle;
  53.  
  54.   showpoints(1,2,3,4,40);
  55. adjust(v_H*fitbasis.uc#+m_a*b_mfit#,v_F*fitbasis.uc#+m_a*b_mfit#); 
  56. show_character; endchar;
  57.  
  58. % character position, but not shape slants with obliqueness
  59. % maximum width=1.5 math_axis
  60.  
  61.  
  62. iff OK "\":  "Left leaning slash";          % need to add shift if w>.45h
  63.   beginchar(oct"134",.45width#+b_mono#,maxheight#,maxdepth#); 
  64.   pickup  mathpen rotated angle((0,h)//-(min(w,.5(h+d)),-d)//);
  65.   top lft z1=(0,h)//;
  66.   bot rt z2=(min(w,.5(h+d)),-d)//;
  67.   x1:=min(x1,x2-2);          
  68.   draw z1--z2;
  69. adjust(v_H*fitbasis.uc#+m_a*b_mfit#,v_H*fitbasis.uc#+m_a*b_mfit#); 
  70. show_character; endchar;
  71.  
  72. % use different mathpen for softness
  73. % limits character to vertical line minus 2 pixels
  74.  
  75.  
  76. iff OK "_":  "Underscore"; 
  77.   beginchar(oct"137",.5width#+mono#,cap#,0); 
  78.   pickup mathpen;
  79.   top lft z1=(0,0);
  80.   top rt z2=(w,0);  
  81.   draw z1--z2;
  82. adjust (0,0); show_character; endchar;
  83.  
  84. % use different mathpen for softness
  85. % no slant of shape with obliqueness
  86. % placement just below the baseline; meant for computer programs where the
  87. %   underscore often has the same token value as a letter
  88.  
  89.  
  90.  
  91.  
  92. iff OK "{": "Left curly brace"; 
  93.   beginchar(oct"173",.4width#+b_mono#,maxheight#,maxdepth#); 
  94.   
  95.   save_num(width_limit)=min(w,.4(h+d)); 
  96.   z40=(width_limit,.5(h-d));
  97.   z41=(width_limit,h)rotatedaround(z40//,-oblique);
  98.   z42=(width_limit,-d)rotatedaround(z40//,-oblique);
  99.  
  100.   pos0(max(1,.5thin_stem.uc),90-oblique);  
  101.   pos1(max(1,.75thin_stem.uc),90-oblique);  
  102.   multpos(2,4)(max(1,.75stem.uc),180-oblique);
  103.   pos3(max(1,.5stem.uc),180-oblique);
  104.   pos5(max(1,.75thin_stem.uc),-90-oblique);  
  105.   pos6(max(1,.5thin_stem.uc),-90-oblique);
  106.   multpos(20,21)(2,90-oblique);  
  107.  
  108.   lft z2r=.25[z41,z42]+.7(.95width_limit,0)rotated(180-oblique);
  109.   lft z3r=.5[z41,z42] +  (.95width_limit,0)rotated(180-oblique);    z20=z3r;
  110.   rt z21 =.5[z41,z42] +  (   width_limit,0)rotated(180-oblique);
  111.   lft z4r=.75[z41,z42]+.7(.95width_limit,0)rotated(180-oblique);
  112.   top z1r=(x41-.2width_limit,h);  
  113.   bot z5r=(x42-.2width_limit,-d);    
  114.   z0r=whatever[z41,z42]; bot y0l=bot y1l;
  115.   z6r=whatever[z41,z42]; top y6l=top y5l;
  116.  
  117.   ref1=z3l{dir -oblique} i_t z4l{downward} i_t z5l{right}...z6l;
  118.   ref2=z6r...z5r{left} o_t z4r{upward} o_t z20l{-dir -oblique}--z21l--
  119.        z21r--z20r{dir -oblique} o_t z2r{upward} o_t z1r{right}...z0r;
  120.   ref3=z0l...z1l{left} i_t z2l{downward} i_t z3l+(0,epsilon){-dir -oblique};
  121.      
  122.   if softpath:
  123.        p1=ref1 softjoin(z6l--z6r)softjoin ref2 softjoin(z0r--z0l)softjoin ref3
  124.           --cycle;
  125.     else:p1=ref1--ref2--ref3--cycle;  fi 
  126.  
  127.  showpoints(0,1,2,3,4,5,6,20,21,40,41,42);
  128. adjust(v_H*fitbasis.uc#+m_a*b_mfit#,v_H*fitbasis.uc#+m_a*b_mfit#); 
  129. show_character; endchar;
  130.  
  131.  
  132. iff OK "}": "Right curly brace"; 
  133.   beginchar(oct"175",.4width#+b_mono#,maxheight#,maxdepth#); 
  134.   
  135.   save_num(width_limit)=min(.95w,.4(h+d)); 
  136.   z40=(0,.5(h-d));
  137.   z41=(0,h)rotatedaround(z40//,-oblique);
  138.   z42=(0,-d)rotatedaround(z40//,-oblique);;
  139.  
  140.   pos0(max(1,.5thin_stem.uc),90-oblique);  
  141.   pos1(max(1,.75thin_stem.uc),90-oblique);  
  142.   multpos(2,4)(max(1,.75stem.uc),-oblique);
  143.   pos3(max(1,.5stem.uc),-oblique);
  144.   pos5(max(1,.75thin_stem.uc),-90-oblique);  
  145.   pos6(max(1,.5thin_stem.uc),-90-oblique);
  146.   multpos(20,21)(2,90-oblique);  
  147.  
  148.   rt z2r=.25[z41,z42]+ .7(width_limit,0)rotated(-oblique);
  149.   rt z3r=.5[z41,z42] +   (width_limit,0)rotated(-oblique);     z20=z3r;
  150.   rt z21=.5[z41,z42] +(min(w,.4(h+d)),0)rotated(-oblique);
  151.   rt z4r=.75[z41,z42]+ .7(width_limit,0)rotated(-oblique);
  152.   top z1r=(x41+.2width_limit,h);  
  153.   bot z5r=(x42+.2width_limit,-d);    
  154.   z0r=whatever[z41,z42]; bot y0l=bot y1l;
  155.   z6r=whatever[z41,z42]; top y6l=top y5l;
  156.  
  157.   ref1=z3l{-dir -oblique} i_t z4l{downward} i_t z5l{left}...z6l;
  158.   ref2=z6r...z5r{right} o_t z4r{upward} o_t z20l{dir -oblique}--z21l--
  159.        z21r--z20r{-dir -oblique} o_t z2r{upward} o_t z1r{left}...z0r;
  160.   ref3=z0l...z1l{right} i_t z2l{downward} i_t z3l+(0,epsilon){dir -oblique};
  161.      
  162.   if softpath:
  163.        p1=ref1 softjoin(z6l--z6r)softjoin ref2 softjoin(z0r--z0l)softjoin ref3
  164.           --cycle;
  165.     else:p1=ref1--ref2--ref3--cycle;  fi 
  166.  
  167.  showpoints(0,1,2,3,4,5,6,20,40,41,42);
  168. adjust(v_H*fitbasis.uc#+m_a*b_mfit#, v_H*fitbasis.uc#+m_a*b_mfit#); 
  169. show_character; endchar;
  170.  
  171.  
  172. iff OK "|":  "Vertical bar";         % need to add shift if w>.45h
  173.   beginchar(oct"174",I_w*width#+a_mono#,maxheight#,maxdepth#);  
  174.   pickup mathpen;
  175.   z0=(.5w,.5[-d,h])//;
  176.   top z1=(x0,h);          
  177.   bot z2=(x0,-d);
  178.   draw z1--z2;
  179. adjust(v_A*fitbasis.uc#+m_a*a_mfit#,v_A*fitbasis.uc#+m_a*a_mfit#); 
  180. show_character; endchar;
  181.  
  182. % use different mathpen for softness
  183. % always vertical; no slant but shifts position with obliqueness
  184.